package com.baby.wheelview;

import java.util.List;

/**
 * 数组滚轮适配器
 * 
 */
public class ArrayWheelAdapter extends WheelAdapter {
	private List<String> data;
	private String label;

	public ArrayWheelAdapter(List<String> data, String label) {
		this.data = data;
		this.label = label;
	}

	@Override
	public int getCount() {
		return this.data.size();
	}

	@Override
	public String getItem(int index) {
		return data.get(index) + label;
	}

	@Override
	public int getValue(int index) {
		return index;
	}

	/**
	 * 获取当前起始数字
	 * 
	 * @return
	 */
	@Override
	public int getStartValue() {
		return 0;
	}

	/**
	 * 获取当前结束数字
	 * 
	 * @return
	 */
	@Override
	public int getEndValue() {
		return this.getCount() - 1;
	}

	/**
	 * 获取数字间隔
	 * 
	 * @return
	 */
	@Override
	public int getInterval() {
		return 1;
	}

	@Override
	public int getValueIndex(int value) {
		return value;
	}

	@Override
	public void setStartValue(int value) {
	}
}
